//
//  RegisteredView.m
//  Sunexpress
//
//  Created by 筱亮 on 2017/5/10.
//  Copyright © 2017年 曹亮. All rights reserved.
//

#import "RegisteredView.h"
#import <SDAutoLayout.h>
@implementation RegisteredView

-(instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self addSubview:self.password];
        [self addSubview:self.pohoneNumber];
        [self addSubview:self.verificationText];
        [self addSubview:self.confirmBtn];
        [self addSubview:self.registeredBtn];
        [self addSubview:self.confirmPassword];
        
        
        
        self.pohoneNumber.sd_layout.
        leftSpaceToView(self,10).
        rightSpaceToView(self,10).
        topSpaceToView(self,120).
        heightIs(50);
        
        self.confirmBtn .sd_layout.
        widthIs(120).
        rightSpaceToView(self,10).
        topSpaceToView(self.pohoneNumber,2).
        heightIs(50);

        
        self.verificationText.sd_layout.
        leftSpaceToView(self,10).
        rightSpaceToView(self.confirmBtn,0).
        topSpaceToView(self.pohoneNumber,2).
        heightIs(50);

        self.password.sd_layout.
        leftSpaceToView(self,10).
        rightSpaceToView(self,10).
        topSpaceToView(self.verificationText,2).
        heightIs(50);
        
        self.confirmPassword.sd_layout.
        leftSpaceToView(self,10).
        rightSpaceToView(self,10).
        topSpaceToView(self.password,2).
        heightIs(50);
        
        self.registeredBtn.sd_layout.
        leftSpaceToView(self,10).
        rightSpaceToView(self,10).
        topSpaceToView(self.confirmPassword,40).
        heightIs(50);

        



        
    }
    return self;
}

-(UITextField *)password
{
    if (!_password) {
        _password = [[UITextField alloc]init];
       
        _password.placeholder = @"  6-20位密码";
        _password.backgroundColor = [UIColor whiteColor];
        _password.font=[UIFont systemFontOfSize:20];
        _password   .secureTextEntry = YES;
    }
    return _password;
}

-(UITextField *)pohoneNumber
{
    if (!_pohoneNumber) {
        _pohoneNumber = [[UITextField alloc]init];
         _pohoneNumber.keyboardType=UIKeyboardTypeNumberPad;
        _pohoneNumber.placeholder =@"   请输入手机号";
        _pohoneNumber.backgroundColor = [UIColor whiteColor];
        _pohoneNumber.font = [UIFont systemFontOfSize:20];
        
        
    }
    return _pohoneNumber;
}

//验证码
-(UITextField*)verificationText
{
    if (!_verificationText) {
        _verificationText = [[UITextField alloc]init];
        _verificationText.placeholder=@"  请输入验证码";
        _verificationText.keyboardType=UIKeyboardTypeNumberPad;
        _verificationText.font =[UIFont systemFontOfSize:20];
        _verificationText.backgroundColor = [UIColor whiteColor];
    }
    return _verificationText;
}

//确认密码
-(UITextField * )confirmPassword
{
    if (!_confirmPassword) {
        _confirmPassword = [[UITextField alloc]init];
        _confirmPassword.placeholder=@"  请确认密码";
        _confirmPassword.font = [UIFont systemFontOfSize:20];
        _confirmPassword.backgroundColor = [UIColor whiteColor];
        _confirmPassword.secureTextEntry = YES;
    }
    return _confirmPassword;
}
//获取验证码
-(UIButton*)confirmBtn
{
    if (!_confirmBtn) {
        _confirmBtn = [[UIButton alloc]init];
        [_confirmBtn setTitle:@"获取验证码" forState:0];
        _confirmBtn.backgroundColor = [UIColor orangeColor];
        _confirmBtn.titleLabel.font = [UIFont systemFontOfSize:16];
    }
    return _confirmBtn;
}
//注册
-(UIButton*)registeredBtn
{
    if (!_registeredBtn) {
        _registeredBtn = [[UIButton alloc]init];
        [_registeredBtn setTitle:@"注册" forState:0];
        _registeredBtn.backgroundColor =[UIColor orangeColor];
        _registeredBtn.titleLabel.font = [UIFont systemFontOfSize:20];
        _registeredBtn.layer.cornerRadius = 7;
        _registeredBtn.layer.masksToBounds = YES;

    }
    return _registeredBtn;
}

@end
